.class public Lt4j/http/HttpClient;
.super Ljava/lang/Object;
.source "HttpClient.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final BAD_GATEWAY:I = 0x1f6

.field private static final BAD_REQUEST:I = 0x190

#the value of this static final field might be set in the static constructor
.field private static final DEBUG:Z = false

.field private static final FORBIDDEN:I = 0x193

.field private static final INTERNAL_SERVER_ERROR:I = 0x1f4

.field private static final NOT_ACCEPTABLE:I = 0x196

.field private static final NOT_AUTHORIZED:I = 0x191

.field private static final NOT_FOUND:I = 0x194

.field private static final NOT_MODIFIED:I = 0x130

.field private static final OK:I = 0xc8

.field private static final SERVICE_UNAVAILABLE:I = 0x1f7

.field private static isJDK14orEarlier:Z = false

.field private static final serialVersionUID:J = 0xb36a81e0d31617cL


# instance fields
.field private accessTokenURL:Ljava/lang/String;

.field private authenticationURL:Ljava/lang/String;

.field private basic:Ljava/lang/String;

.field private connectionTimeout:I

.field private oauth:Lt4j/http/OAuth;

.field private oauthToken:Lt4j/http/OAuthToken;

.field private password:Ljava/lang/String;

.field private proxyAuthPassword:Ljava/lang/String;

.field private proxyAuthUser:Ljava/lang/String;

.field private proxyHost:Ljava/lang/String;

.field private proxyPort:I

.field private readTimeout:I

.field private requestHeaders:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private requestTokenURL:Ljava/lang/String;

.field private retryCount:I

.field private retryIntervalMillis:I

.field private userId:Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 8

    .prologue
    const/4 v3, 0x1

    const/4 v2, 0x0

    .line 77
    invoke-static {}, Lt4j/Configuration;->getDebug()Z

    move-result v4

    sput-boolean v4, Lt4j/http/HttpClient;->DEBUG:Z

    .line 91
    sput-boolean v2, Lt4j/http/HttpClient;->isJDK14orEarlier:Z

    .line 106
    :try_start_0
    const-string v4, "java.specification.version"

    invoke-static {v4}, Ljava/lang/System;->getProperty(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 107
    .local v1, versionStr:Ljava/lang/String;
    if-eqz v1, :cond_1

    .line 108
    const-wide/high16 v4, 0x3ff8

    invoke-static {v1}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v6

    cmpl-double v4, v4, v6

    if-lez v4, :cond_0

    move v2, v3

    :cond_0
    sput-boolean v2, Lt4j/http/HttpClient;->isJDK14orEarlier:Z
    :try_end_0
    .catch Ljava/security/AccessControlException; {:try_start_0 .. :try_end_0} :catch_0

    .line 62
    :cond_1
    :goto_0
    return-void

    .line 110
    :catch_0
    move-exception v0

    .line 111
    .local v0, ace:Ljava/security/AccessControlException;
    sput-boolean v3, Lt4j/http/HttpClient;->isJDK14orEarlier:Z

    goto :goto_0
.end method

.method public constructor <init>()V
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 121
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 80
    invoke-static {}, Lt4j/Configuration;->getRetryCount()I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->retryCount:I

    .line 81
    invoke-static {}, Lt4j/Configuration;->getRetryIntervalSecs()I

    move-result v0

    mul-int/lit16 v0, v0, 0x3e8

    iput v0, p0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    .line 82
    invoke-static {}, Lt4j/Configuration;->getUser()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    .line 83
    invoke-static {}, Lt4j/Configuration;->getPassword()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    .line 84
    invoke-static {}, Lt4j/Configuration;->getProxyHost()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    .line 85
    invoke-static {}, Lt4j/Configuration;->getProxyPort()I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->proxyPort:I

    .line 86
    invoke-static {}, Lt4j/Configuration;->getProxyUser()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    .line 87
    invoke-static {}, Lt4j/Configuration;->getProxyPassword()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    .line 88
    invoke-static {}, Lt4j/Configuration;->getConnectionTimeout()I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    .line 89
    invoke-static {}, Lt4j/Configuration;->getReadTimeout()I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->readTimeout:I

    .line 92
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    .line 94
    iput-object v2, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    .line 96
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {}, Lt4j/Configuration;->getScheme()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "api.t.163.com/oauth/request_token"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    .line 97
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {}, Lt4j/Configuration;->getScheme()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "api.t.163.com/oauth/authenticate"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->authenticationURL:Ljava/lang/String;

    .line 98
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {}, Lt4j/Configuration;->getScheme()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "api.t.163.com/oauth/access_token"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    .line 100
    iput-object v2, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 122
    iput-object v2, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    .line 123
    invoke-virtual {p0, v2}, Lt4j/http/HttpClient;->setUserAgent(Ljava/lang/String;)V

    .line 124
    invoke-virtual {p0, v2, v2}, Lt4j/http/HttpClient;->setOAuthConsumer(Ljava/lang/String;Ljava/lang/String;)V

    .line 125
    const-string v0, "Accept-Encoding"

    const-string v1, "gzip"

    invoke-virtual {p0, v0, v1}, Lt4j/http/HttpClient;->setRequestHeader(Ljava/lang/String;Ljava/lang/String;)V

    .line 126
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;)V
    .locals 0
    .parameter "userId"
    .parameter "password"

    .prologue
    .line 116
    invoke-direct {p0}, Lt4j/http/HttpClient;-><init>()V

    .line 117
    invoke-virtual {p0, p1}, Lt4j/http/HttpClient;->setUserId(Ljava/lang/String;)V

    .line 118
    invoke-virtual {p0, p2}, Lt4j/http/HttpClient;->setPassword(Ljava/lang/String;)V

    .line 119
    return-void
.end method

.method static synthetic access$0(Lt4j/http/HttpClient;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 86
    iget-object v0, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$1(Lt4j/http/HttpClient;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 87
    iget-object v0, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    return-object v0
.end method

.method private encodeBasicAuthenticationString()V
    .locals 5

    .prologue
    .line 375
    iget-object v0, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 376
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "Basic "

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 377
    new-instance v1, Ljava/lang/String;

    new-instance v2, Lt4j/http/BASE64Encoder;

    invoke-direct {v2}, Lt4j/http/BASE64Encoder;-><init>()V

    new-instance v3, Ljava/lang/StringBuilder;

    iget-object v4, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ":"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    iget-object v4, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->getBytes()[B

    move-result-object v3

    invoke-virtual {v2, v3}, Lt4j/http/BASE64Encoder;->encode([B)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/String;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    .line 376
    iput-object v0, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    .line 378
    const/4 v0, 0x0

    iput-object v0, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    .line 380
    :cond_0
    return-void
.end method

.method public static encodeParameters([Lt4j/http/PostParameter;)Ljava/lang/String;
    .locals 5
    .parameter "postParams"

    .prologue
    .line 597
    new-instance v0, Ljava/lang/StringBuffer;

    invoke-direct {v0}, Ljava/lang/StringBuffer;-><init>()V

    .line 598
    .local v0, buf:Ljava/lang/StringBuffer;
    const/4 v1, 0x0

    .local v1, j:I
    :goto_0
    array-length v2, p0

    if-lt v1, v2, :cond_0

    .line 608
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v2

    return-object v2

    .line 599
    :cond_0
    if-eqz v1, :cond_1

    .line 600
    const-string v2, "&"

    invoke-virtual {v0, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    .line 603
    :cond_1
    :try_start_0
    aget-object v2, p0, v1

    iget-object v2, v2, Lt4j/http/PostParameter;->name:Ljava/lang/String;

    const-string v3, "UTF-8"

    invoke-static {v2, v3}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    .line 604
    const-string v3, "="

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;

    move-result-object v2

    aget-object v3, p0, v1

    iget-object v3, v3, Lt4j/http/PostParameter;->value:Ljava/lang/String;

    const-string v4, "UTF-8"

    invoke-static {v3, v4}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuffer;->append(Ljava/lang/String;)Ljava/lang/StringBuffer;
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    .line 598
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 605
    :catch_0
    move-exception v2

    goto :goto_1
.end method

.method private static getCause(I)Ljava/lang/String;
    .locals 3
    .parameter "statusCode"

    .prologue
    .line 763
    const/4 v0, 0x0

    .line 764
    .local v0, cause:Ljava/lang/String;
    sparse-switch p0, :sswitch_data_0

    .line 792
    const-string v0, ""

    .line 794
    :goto_0
    :sswitch_0
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, ":"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1

    .line 768
    :sswitch_1
    const-string v0, "The request was invalid.  An accompanying error message will explain why. This is the status code will be returned during rate limiting."

    .line 769
    goto :goto_0

    .line 771
    :sswitch_2
    const-string v0, "Authentication credentials were missing or incorrect."

    .line 772
    goto :goto_0

    .line 774
    :sswitch_3
    const-string v0, "The request is understood, but it has been refused.  An accompanying error message will explain why."

    .line 775
    goto :goto_0

    .line 777
    :sswitch_4
    const-string v0, "The URI requested is invalid or the resource requested, such as a user, does not exists."

    .line 778
    goto :goto_0

    .line 780
    :sswitch_5
    const-string v0, "Returned by the Search API when an invalid format is specified in the request."

    .line 781
    goto :goto_0

    .line 783
    :sswitch_6
    const-string v0, "Something is broken.  Please post to the group so the team can investigate."

    .line 784
    goto :goto_0

    .line 786
    :sswitch_7
    const-string v0, "server is down or being upgraded."

    .line 787
    goto :goto_0

    .line 789
    :sswitch_8
    const-string v0, "Service Unavailable: The servers are up, but overloaded with requests. Try again later. The search and trend methods use this to indicate when you are being rate limited."

    .line 790
    goto :goto_0

    .line 764
    :sswitch_data_0
    .sparse-switch
        0x130 -> :sswitch_0
        0x190 -> :sswitch_1
        0x191 -> :sswitch_2
        0x193 -> :sswitch_3
        0x194 -> :sswitch_4
        0x196 -> :sswitch_5
        0x1f4 -> :sswitch_6
        0x1f6 -> :sswitch_7
        0x1f7 -> :sswitch_8
    .end sparse-switch
.end method

.method private getConnection(Ljava/lang/String;)Ljava/net/HttpURLConnection;
    .locals 5
    .parameter "url"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 653
    const/4 v0, 0x0

    .line 654
    .local v0, con:Ljava/net/HttpURLConnection;
    iget-object v2, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    if-eqz v2, :cond_4

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_4

    .line 655
    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    const-string v3, ""

    invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-nez v2, :cond_0

    .line 656
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Proxy AuthUser: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 657
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Proxy AuthPassword: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 658
    new-instance v2, Lt4j/http/HttpClient$3;

    invoke-direct {v2, p0}, Lt4j/http/HttpClient$3;-><init>(Lt4j/http/HttpClient;)V

    invoke-static {v2}, Ljava/net/Authenticator;->setDefault(Ljava/net/Authenticator;)V

    .line 673
    :cond_0
    new-instance v1, Ljava/net/Proxy;

    sget-object v2, Ljava/net/Proxy$Type;->HTTP:Ljava/net/Proxy$Type;

    .line 674
    iget-object v3, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    iget v4, p0, Lt4j/http/HttpClient;->proxyPort:I

    invoke-static {v3, v4}, Ljava/net/InetSocketAddress;->createUnresolved(Ljava/lang/String;I)Ljava/net/InetSocketAddress;

    move-result-object v3

    .line 673
    invoke-direct {v1, v2, v3}, Ljava/net/Proxy;-><init>(Ljava/net/Proxy$Type;Ljava/net/SocketAddress;)V

    .line 675
    .local v1, proxy:Ljava/net/Proxy;
    sget-boolean v2, Lt4j/http/HttpClient;->DEBUG:Z

    if-eqz v2, :cond_1

    .line 676
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Opening proxied connection("

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ":"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget v3, p0, Lt4j/http/HttpClient;->proxyPort:I

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ")"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 678
    :cond_1
    new-instance v2, Ljava/net/URL;

    invoke-direct {v2, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v1}, Ljava/net/URL;->openConnection(Ljava/net/Proxy;)Ljava/net/URLConnection;

    move-result-object v0

    .end local v0           #con:Ljava/net/HttpURLConnection;
    check-cast v0, Ljava/net/HttpURLConnection;

    .line 682
    .end local v1           #proxy:Ljava/net/Proxy;
    .restart local v0       #con:Ljava/net/HttpURLConnection;
    :goto_0
    iget v2, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    if-lez v2, :cond_2

    sget-boolean v2, Lt4j/http/HttpClient;->isJDK14orEarlier:Z

    if-nez v2, :cond_2

    .line 683
    iget v2, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setConnectTimeout(I)V

    .line 685
    :cond_2
    iget v2, p0, Lt4j/http/HttpClient;->readTimeout:I

    if-lez v2, :cond_3

    sget-boolean v2, Lt4j/http/HttpClient;->isJDK14orEarlier:Z

    if-nez v2, :cond_3

    .line 686
    iget v2, p0, Lt4j/http/HttpClient;->readTimeout:I

    invoke-virtual {v0, v2}, Ljava/net/HttpURLConnection;->setReadTimeout(I)V

    .line 688
    :cond_3
    return-object v0

    .line 680
    :cond_4
    new-instance v2, Ljava/net/URL;

    invoke-direct {v2, p1}, Ljava/net/URL;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/net/URL;->openConnection()Ljava/net/URLConnection;

    move-result-object v0

    .end local v0           #con:Ljava/net/HttpURLConnection;
    check-cast v0, Ljava/net/HttpURLConnection;

    .restart local v0       #con:Ljava/net/HttpURLConnection;
    goto :goto_0
.end method

.method private static log(Ljava/lang/String;)V
    .locals 3
    .parameter "message"

    .prologue
    .line 751
    sget-boolean v0, Lt4j/http/HttpClient;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 752
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "["

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    new-instance v2, Ljava/util/Date;

    invoke-direct {v2}, Ljava/util/Date;-><init>()V

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, "]"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    .line 754
    :cond_0
    return-void
.end method

.method private static log(Ljava/lang/String;Ljava/lang/String;)V
    .locals 2
    .parameter "message"
    .parameter "message2"

    .prologue
    .line 757
    sget-boolean v0, Lt4j/http/HttpClient;->DEBUG:Z

    if-eqz v0, :cond_0

    .line 758
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-static {p0}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 760
    :cond_0
    return-void
.end method

.method private setHeaders(Ljava/lang/String;[Lt4j/http/PostParameter;Ljava/net/HttpURLConnection;ZLjava/lang/String;)V
    .locals 5
    .parameter "url"
    .parameter "params"
    .parameter "connection"
    .parameter "authenticated"
    .parameter "httpMethod"

    .prologue
    .line 618
    const-string v2, "Request: "

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 619
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {p5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v3, " "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2, p1}, Lt4j/http/HttpClient;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 621
    if-eqz p4, :cond_1

    .line 622
    iget-object v2, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-nez v2, :cond_0

    .line 624
    :cond_0
    const/4 v0, 0x0

    .line 625
    .local v0, authorization:Ljava/lang/String;
    iget-object v2, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-eqz v2, :cond_2

    .line 627
    iget-object v2, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    iget-object v3, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    invoke-virtual {v2, p5, p1, p2, v3}, Lt4j/http/OAuth;->generateAuthorizationHeader(Ljava/lang/String;Ljava/lang/String;[Lt4j/http/PostParameter;Lt4j/http/OAuthToken;)Ljava/lang/String;

    move-result-object v0

    .line 635
    :goto_0
    const-string v2, "Authorization"

    invoke-virtual {p3, v2, v0}, Ljava/net/HttpURLConnection;->addRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 636
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Authorization: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 638
    .end local v0           #authorization:Ljava/lang/String;
    :cond_1
    iget-object v2, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v2}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-nez v2, :cond_4

    .line 642
    return-void

    .line 628
    .restart local v0       #authorization:Ljava/lang/String;
    :cond_2
    iget-object v2, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-eqz v2, :cond_3

    .line 630
    iget-object v0, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    goto :goto_0

    .line 632
    :cond_3
    new-instance v2, Ljava/lang/IllegalStateException;

    .line 633
    const-string v3, "Neither user ID/password combination nor OAuth consumer key/secret combination supplied"

    .line 632
    invoke-direct {v2, v3}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 638
    .end local v0           #authorization:Ljava/lang/String;
    :cond_4
    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 639
    .local v1, key:Ljava/lang/String;
    iget-object v2, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {p3, v1, v2}, Ljava/net/HttpURLConnection;->addRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 640
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v2, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, ": "

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v2, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v2, v1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v4, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    goto :goto_1
.end method


# virtual methods
.method public delete(Ljava/lang/String;Z)Lt4j/http/Response;
    .locals 2
    .parameter "url"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 414
    const/4 v0, 0x0

    const-string v1, "DELETE"

    invoke-virtual {p0, p1, v0, p2, v1}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;ZLjava/lang/String;)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public equals(Ljava/lang/Object;)Z
    .locals 5
    .parameter "o"

    .prologue
    const/4 v1, 0x1

    const/4 v2, 0x0

    .line 693
    if-ne p0, p1, :cond_1

    .line 725
    :cond_0
    :goto_0
    return v1

    .line 694
    :cond_1
    instance-of v3, p1, Lt4j/http/HttpClient;

    if-nez v3, :cond_2

    move v1, v2

    goto :goto_0

    :cond_2
    move-object v0, p1

    .line 696
    check-cast v0, Lt4j/http/HttpClient;

    .line 698
    .local v0, that:Lt4j/http/HttpClient;
    iget v3, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    iget v4, v0, Lt4j/http/HttpClient;->connectionTimeout:I

    if-eq v3, v4, :cond_3

    move v1, v2

    goto :goto_0

    .line 699
    :cond_3
    iget v3, p0, Lt4j/http/HttpClient;->proxyPort:I

    iget v4, v0, Lt4j/http/HttpClient;->proxyPort:I

    if-eq v3, v4, :cond_4

    move v1, v2

    goto :goto_0

    .line 700
    :cond_4
    iget v3, p0, Lt4j/http/HttpClient;->readTimeout:I

    iget v4, v0, Lt4j/http/HttpClient;->readTimeout:I

    if-eq v3, v4, :cond_5

    move v1, v2

    goto :goto_0

    .line 701
    :cond_5
    iget v3, p0, Lt4j/http/HttpClient;->retryCount:I

    iget v4, v0, Lt4j/http/HttpClient;->retryCount:I

    if-eq v3, v4, :cond_6

    move v1, v2

    goto :goto_0

    .line 702
    :cond_6
    iget v3, p0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    iget v4, v0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    if-eq v3, v4, :cond_7

    move v1, v2

    goto :goto_0

    .line 703
    :cond_7
    iget-object v3, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    if-eqz v3, :cond_9

    iget-object v3, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_a

    :cond_8
    move v1, v2

    .line 704
    goto :goto_0

    .line 703
    :cond_9
    iget-object v3, v0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    if-nez v3, :cond_8

    .line 705
    :cond_a
    iget-object v3, p0, Lt4j/http/HttpClient;->authenticationURL:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->authenticationURL:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_b

    move v1, v2

    goto :goto_0

    .line 706
    :cond_b
    iget-object v3, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-eqz v3, :cond_d

    iget-object v3, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_e

    :cond_c
    move v1, v2

    .line 707
    goto :goto_0

    .line 706
    :cond_d
    iget-object v3, v0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-nez v3, :cond_c

    .line 708
    :cond_e
    iget-object v3, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-eqz v3, :cond_10

    iget-object v3, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    iget-object v4, v0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    invoke-virtual {v3, v4}, Lt4j/http/OAuth;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_11

    :cond_f
    move v1, v2

    .line 709
    goto :goto_0

    .line 708
    :cond_10
    iget-object v3, v0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-nez v3, :cond_f

    .line 710
    :cond_11
    iget-object v3, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    if-eqz v3, :cond_13

    iget-object v3, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    iget-object v4, v0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    invoke-virtual {v3, v4}, Lt4j/http/OAuthToken;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_14

    :cond_12
    move v1, v2

    .line 711
    goto/16 :goto_0

    .line 710
    :cond_13
    iget-object v3, v0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    if-nez v3, :cond_12

    .line 712
    :cond_14
    iget-object v3, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    if-eqz v3, :cond_16

    iget-object v3, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_17

    :cond_15
    move v1, v2

    .line 713
    goto/16 :goto_0

    .line 712
    :cond_16
    iget-object v3, v0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    if-nez v3, :cond_15

    .line 714
    :cond_17
    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    if-eqz v3, :cond_19

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_1a

    :cond_18
    move v1, v2

    .line 715
    goto/16 :goto_0

    .line 714
    :cond_19
    iget-object v3, v0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    if-nez v3, :cond_18

    .line 716
    :cond_1a
    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    if-eqz v3, :cond_1c

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_1d

    :cond_1b
    move v1, v2

    .line 717
    goto/16 :goto_0

    .line 716
    :cond_1c
    iget-object v3, v0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    if-nez v3, :cond_1b

    .line 718
    :cond_1d
    iget-object v3, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    if-eqz v3, :cond_1f

    iget-object v3, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_20

    :cond_1e
    move v1, v2

    .line 719
    goto/16 :goto_0

    .line 718
    :cond_1f
    iget-object v3, v0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    if-nez v3, :cond_1e

    .line 720
    :cond_20
    iget-object v3, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    iget-object v4, v0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v3, v4}, Ljava/util/Map;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_21

    move v1, v2

    goto/16 :goto_0

    .line 721
    :cond_21
    iget-object v3, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_22

    move v1, v2

    goto/16 :goto_0

    .line 722
    :cond_22
    iget-object v3, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    if-eqz v3, :cond_23

    iget-object v3, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    iget-object v4, v0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_0

    :goto_1
    move v1, v2

    .line 723
    goto/16 :goto_0

    .line 722
    :cond_23
    iget-object v3, v0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    if-eqz v3, :cond_0

    goto :goto_1
.end method

.method public get(Ljava/lang/String;)Lt4j/http/Response;
    .locals 2
    .parameter "url"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 494
    const/4 v0, 0x0

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v0, v1}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public get(Ljava/lang/String;Z)Lt4j/http/Response;
    .locals 1
    .parameter "url"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 490
    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, p2}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public getAccessTokenURL()Ljava/lang/String;
    .locals 1

    .prologue
    .line 298
    iget-object v0, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    return-object v0
.end method

.method public getAuthenticationRL()Ljava/lang/String;
    .locals 1

    .prologue
    .line 290
    iget-object v0, p0, Lt4j/http/HttpClient;->authenticationURL:Ljava/lang/String;

    return-object v0
.end method

.method public getConnectionTimeout()I
    .locals 1

    .prologue
    .line 351
    iget v0, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    return v0
.end method

.method public getOAuthAccessToken(Ljava/lang/String;Ljava/lang/String;)Lt4j/http/AccessToken;
    .locals 5
    .parameter "token"
    .parameter "tokenSecret"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 245
    :try_start_0
    new-instance v1, Lt4j/http/HttpClient$1;

    invoke-direct {v1, p0, p1, p2}, Lt4j/http/HttpClient$1;-><init>(Lt4j/http/HttpClient;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 246
    new-instance v1, Lt4j/http/AccessToken;

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    const/4 v3, 0x0

    new-array v3, v3, [Lt4j/http/PostParameter;

    const/4 v4, 0x1

    invoke-virtual {p0, v2, v3, v4}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/http/AccessToken;-><init>(Lt4j/http/Response;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;
    :try_end_0
    .catch Lt4j/TBlogException; {:try_start_0 .. :try_end_0} :catch_0

    .line 250
    iget-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v1, Lt4j/http/AccessToken;

    return-object v1

    .line 247
    :catch_0
    move-exception v0

    .line 248
    .local v0, te:Lt4j/TBlogException;
    new-instance v1, Lt4j/TBlogException;

    const-string v2, "The user has not given access to the account."

    invoke-virtual {v0}, Lt4j/TBlogException;->getStatusCode()I

    move-result v3

    invoke-direct {v1, v2, v0, v3}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v1
.end method

.method public getOAuthAccessToken(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lt4j/http/AccessToken;
    .locals 7
    .parameter "token"
    .parameter "tokenSecret"
    .parameter "oauth_verifier"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 264
    :try_start_0
    new-instance v1, Lt4j/http/HttpClient$2;

    invoke-direct {v1, p0, p1, p2}, Lt4j/http/HttpClient$2;-><init>(Lt4j/http/HttpClient;Ljava/lang/String;Ljava/lang/String;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 265
    new-instance v1, Lt4j/http/AccessToken;

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    .line 266
    const/4 v3, 0x1

    new-array v3, v3, [Lt4j/http/PostParameter;

    const/4 v4, 0x0

    new-instance v5, Lt4j/http/PostParameter;

    const-string v6, "oauth_verifier"

    invoke-direct {v5, v6, p3}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 265
    invoke-virtual {p0, v2, v3, v4}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/http/AccessToken;-><init>(Lt4j/http/Response;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;
    :try_end_0
    .catch Lt4j/TBlogException; {:try_start_0 .. :try_end_0} :catch_0

    .line 270
    iget-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v1, Lt4j/http/AccessToken;

    return-object v1

    .line 267
    :catch_0
    move-exception v0

    .line 268
    .local v0, te:Lt4j/TBlogException;
    new-instance v1, Lt4j/TBlogException;

    const-string v2, "The user has not given access to the account."

    invoke-virtual {v0}, Lt4j/TBlogException;->getStatusCode()I

    move-result v3

    invoke-direct {v1, v2, v0, v3}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v1
.end method

.method public getOAuthAccessToken(Lt4j/http/RequestToken;)Lt4j/http/AccessToken;
    .locals 5
    .parameter "token"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 187
    :try_start_0
    iput-object p1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 188
    new-instance v1, Lt4j/http/AccessToken;

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    const/4 v3, 0x0

    new-array v3, v3, [Lt4j/http/PostParameter;

    const/4 v4, 0x1

    invoke-virtual {p0, v2, v3, v4}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/http/AccessToken;-><init>(Lt4j/http/Response;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;
    :try_end_0
    .catch Lt4j/TBlogException; {:try_start_0 .. :try_end_0} :catch_0

    .line 192
    iget-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v1, Lt4j/http/AccessToken;

    return-object v1

    .line 189
    :catch_0
    move-exception v0

    .line 190
    .local v0, te:Lt4j/TBlogException;
    new-instance v1, Lt4j/TBlogException;

    const-string v2, "The user has not given access to the account."

    invoke-virtual {v0}, Lt4j/TBlogException;->getStatusCode()I

    move-result v3

    invoke-direct {v1, v2, v0, v3}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v1
.end method

.method public getOAuthAccessToken(Lt4j/http/RequestToken;Ljava/lang/String;)Lt4j/http/AccessToken;
    .locals 7
    .parameter "token"
    .parameter "pin"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 227
    :try_start_0
    iput-object p1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 228
    new-instance v1, Lt4j/http/AccessToken;

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    .line 229
    const/4 v3, 0x1

    new-array v3, v3, [Lt4j/http/PostParameter;

    const/4 v4, 0x0

    new-instance v5, Lt4j/http/PostParameter;

    const-string v6, "oauth_verifier"

    invoke-direct {v5, v6, p2}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 228
    invoke-virtual {p0, v2, v3, v4}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/http/AccessToken;-><init>(Lt4j/http/Response;)V

    iput-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;
    :try_end_0
    .catch Lt4j/TBlogException; {:try_start_0 .. :try_end_0} :catch_0

    .line 233
    iget-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v1, Lt4j/http/AccessToken;

    return-object v1

    .line 230
    :catch_0
    move-exception v0

    .line 231
    .local v0, te:Lt4j/TBlogException;
    new-instance v1, Lt4j/TBlogException;

    const-string v2, "The user has not given access to the account."

    invoke-virtual {v0}, Lt4j/TBlogException;->getStatusCode()I

    move-result v3

    invoke-direct {v1, v2, v0, v3}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v1
.end method

.method public getOAuthRequestToken()Lt4j/http/RequestToken;
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 175
    new-instance v0, Lt4j/http/RequestToken;

    iget-object v1, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    const/4 v2, 0x0

    const/4 v3, 0x1

    invoke-virtual {p0, v1, v2, v3}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v1

    invoke-direct {v0, v1, p0}, Lt4j/http/RequestToken;-><init>(Lt4j/http/Response;Lt4j/http/HttpClient;)V

    iput-object v0, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 176
    iget-object v0, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v0, Lt4j/http/RequestToken;

    return-object v0
.end method

.method public getPassword()Ljava/lang/String;
    .locals 1

    .prologue
    .line 143
    iget-object v0, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    return-object v0
.end method

.method public getProxyAuthPassword()Ljava/lang/String;
    .locals 1

    .prologue
    .line 339
    iget-object v0, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    return-object v0
.end method

.method public getProxyAuthUser()Ljava/lang/String;
    .locals 1

    .prologue
    .line 327
    iget-object v0, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    return-object v0
.end method

.method public getProxyHost()Ljava/lang/String;
    .locals 1

    .prologue
    .line 302
    iget-object v0, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    return-object v0
.end method

.method public getProxyPort()I
    .locals 1

    .prologue
    .line 315
    iget v0, p0, Lt4j/http/HttpClient;->proxyPort:I

    return v0
.end method

.method public getReadTimeout()I
    .locals 1

    .prologue
    .line 363
    iget v0, p0, Lt4j/http/HttpClient;->readTimeout:I

    return v0
.end method

.method public getRequestHeader(Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .parameter "name"

    .prologue
    .line 649
    iget-object v0, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    return-object v0
.end method

.method public getRequestTokenURL()Ljava/lang/String;
    .locals 1

    .prologue
    .line 286
    iget-object v0, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    return-object v0
.end method

.method public getUserAgent()Ljava/lang/String;
    .locals 1

    .prologue
    .line 394
    const-string v0, "User-Agent"

    invoke-virtual {p0, v0}, Lt4j/http/HttpClient;->getRequestHeader(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getUserId()Ljava/lang/String;
    .locals 1

    .prologue
    .line 139
    iget-object v0, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    return-object v0
.end method

.method public getXAuthAccessToken(Ljava/lang/String;Ljava/lang/String;Z)Lt4j/http/AccessToken;
    .locals 7
    .parameter "passport"
    .parameter "password"
    .parameter "isMD5"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    const/4 v6, 0x1

    .line 204
    const-string v1, "1"

    .line 205
    .local v1, passtype:Ljava/lang/String;
    if-eqz p3, :cond_0

    .line 206
    const-string v1, "0"

    .line 209
    :cond_0
    const/4 v2, 0x4

    new-array v0, v2, [Lt4j/http/PostParameter;

    const/4 v2, 0x0

    .line 210
    new-instance v3, Lt4j/http/PostParameter;

    const-string v4, "x_auth_username"

    invoke-direct {v3, v4, p1}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v3, v0, v2

    .line 211
    new-instance v2, Lt4j/http/PostParameter;

    const-string v3, "x_auth_password"

    invoke-direct {v2, v3, p2}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v2, v0, v6

    const/4 v2, 0x2

    .line 212
    new-instance v3, Lt4j/http/PostParameter;

    const-string v4, "x_auth_mode"

    const-string v5, "client_auth"

    invoke-direct {v3, v4, v5}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v3, v0, v2

    const/4 v2, 0x3

    .line 213
    new-instance v3, Lt4j/http/PostParameter;

    const-string v4, "x_auth_passtype"

    invoke-direct {v3, v4, v1}, Lt4j/http/PostParameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v3, v0, v2

    .line 215
    .local v0, params:[Lt4j/http/PostParameter;
    new-instance v2, Lt4j/http/AccessToken;

    iget-object v3, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    invoke-virtual {p0, v3, v0, v6}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v3

    invoke-direct {v2, v3}, Lt4j/http/AccessToken;-><init>(Lt4j/http/Response;)V

    iput-object v2, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 216
    iget-object v2, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v2, Lt4j/http/AccessToken;

    return-object v2
.end method

.method public hashCode()I
    .locals 4

    .prologue
    const/4 v1, 0x0

    .line 730
    iget-object v2, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-eqz v2, :cond_1

    iget-object v2, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v0

    .line 731
    .local v0, result:I
    :goto_0
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lt4j/http/HttpClient;->retryCount:I

    add-int v0, v2, v3

    .line 732
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    add-int v0, v2, v3

    .line 733
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    if-eqz v2, :cond_2

    iget-object v2, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_1
    add-int v0, v3, v2

    .line 734
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    if-eqz v2, :cond_3

    iget-object v2, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_2
    add-int v0, v3, v2

    .line 735
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    if-eqz v2, :cond_4

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_3
    add-int v0, v3, v2

    .line 736
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lt4j/http/HttpClient;->proxyPort:I

    add-int v0, v2, v3

    .line 737
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    if-eqz v2, :cond_5

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_4
    add-int v0, v3, v2

    .line 738
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    if-eqz v2, :cond_6

    iget-object v2, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_5
    add-int v0, v3, v2

    .line 739
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    add-int v0, v2, v3

    .line 740
    mul-int/lit8 v2, v0, 0x1f

    iget v3, p0, Lt4j/http/HttpClient;->readTimeout:I

    add-int v0, v2, v3

    .line 741
    mul-int/lit8 v2, v0, 0x1f

    iget-object v3, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v3}, Ljava/util/Map;->hashCode()I

    move-result v3

    add-int v0, v2, v3

    .line 742
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-eqz v2, :cond_7

    iget-object v2, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    invoke-virtual {v2}, Lt4j/http/OAuth;->hashCode()I

    move-result v2

    :goto_6
    add-int v0, v3, v2

    .line 743
    mul-int/lit8 v2, v0, 0x1f

    iget-object v3, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->hashCode()I

    move-result v3

    add-int v0, v2, v3

    .line 744
    mul-int/lit8 v2, v0, 0x1f

    iget-object v3, p0, Lt4j/http/HttpClient;->authenticationURL:Ljava/lang/String;

    invoke-virtual {v3}, Ljava/lang/String;->hashCode()I

    move-result v3

    add-int v0, v2, v3

    .line 745
    mul-int/lit8 v3, v0, 0x1f

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    if-eqz v2, :cond_8

    iget-object v2, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->hashCode()I

    move-result v2

    :goto_7
    add-int v0, v3, v2

    .line 746
    mul-int/lit8 v2, v0, 0x1f

    iget-object v3, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    if-eqz v3, :cond_0

    iget-object v1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    invoke-virtual {v1}, Lt4j/http/OAuthToken;->hashCode()I

    move-result v1

    :cond_0
    add-int v0, v2, v1

    .line 747
    return v0

    .end local v0           #result:I
    :cond_1
    move v0, v1

    .line 730
    goto/16 :goto_0

    .restart local v0       #result:I
    :cond_2
    move v2, v1

    .line 733
    goto/16 :goto_1

    :cond_3
    move v2, v1

    .line 734
    goto/16 :goto_2

    :cond_4
    move v2, v1

    .line 735
    goto/16 :goto_3

    :cond_5
    move v2, v1

    .line 737
    goto :goto_4

    :cond_6
    move v2, v1

    .line 738
    goto :goto_5

    :cond_7
    move v2, v1

    .line 742
    goto :goto_6

    :cond_8
    move v2, v1

    .line 745
    goto :goto_7
.end method

.method protected httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;
    .locals 4
    .parameter "url"
    .parameter "postParams"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 499
    const/4 v0, 0x1

    .line 500
    .local v0, len:I
    move-object v2, p2

    .line 501
    .local v2, newPostParameters:[Lt4j/http/PostParameter;
    const-string v1, "GET"

    .line 502
    .local v1, method:Ljava/lang/String;
    if-eqz p2, :cond_0

    .line 503
    const-string v1, "POST"

    .line 504
    array-length v0, p2

    .line 507
    :cond_0
    invoke-virtual {p0, p1, v2, p3, v1}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;ZLjava/lang/String;)Lt4j/http/Response;

    move-result-object v3

    return-object v3
.end method

.method public httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;ZLjava/lang/String;)Lt4j/http/Response;
    .locals 21
    .parameter "url"
    .parameter "postParams"
    .parameter "authenticated"
    .parameter "httpMethod"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 513
    move-object/from16 v0, p0

    iget v2, v0, Lt4j/http/HttpClient;->retryCount:I

    add-int/lit8 v18, v2, 0x1

    .line 514
    .local v18, retry:I
    const/4 v13, 0x0

    .line 515
    .local v13, res:Lt4j/http/Response;
    const/16 v17, 0x0

    .local v17, retriedCount:I
    move-object v14, v13

    .end local v13           #res:Lt4j/http/Response;
    .local v14, res:Lt4j/http/Response;
    :goto_0
    move/from16 v0, v17

    move/from16 v1, v18

    if-lt v0, v1, :cond_0

    move-object v13, v14

    .line 593
    .end local v14           #res:Lt4j/http/Response;
    .restart local v13       #res:Lt4j/http/Response;
    :goto_1
    return-object v13

    .line 516
    .end local v13           #res:Lt4j/http/Response;
    .restart local v14       #res:Lt4j/http/Response;
    :cond_0
    const/4 v15, -0x1

    .line 518
    .local v15, responseCode:I
    const/4 v5, 0x0

    .line 519
    .local v5, con:Ljava/net/HttpURLConnection;
    const/4 v11, 0x0

    .line 521
    .local v11, osw:Ljava/io/OutputStream;
    :try_start_0
    invoke-direct/range {p0 .. p1}, Lt4j/http/HttpClient;->getConnection(Ljava/lang/String;)Ljava/net/HttpURLConnection;

    move-result-object v5

    .line 522
    const/4 v2, 0x1

    invoke-virtual {v5, v2}, Ljava/net/HttpURLConnection;->setDoInput(Z)V

    move-object/from16 v2, p0

    move-object/from16 v3, p1

    move-object/from16 v4, p2

    move/from16 v6, p3

    move-object/from16 v7, p4

    .line 523
    invoke-direct/range {v2 .. v7}, Lt4j/http/HttpClient;->setHeaders(Ljava/lang/String;[Lt4j/http/PostParameter;Ljava/net/HttpURLConnection;ZLjava/lang/String;)V

    .line 524
    if-nez p2, :cond_1

    const-string v2, "POST"

    move-object/from16 v0, p4

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_6

    .line 525
    :cond_1
    const-string v2, "POST"

    invoke-virtual {v5, v2}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V

    .line 526
    const-string v2, "Content-Type"

    .line 527
    const-string v3, "application/x-www-form-urlencoded"

    .line 526
    invoke-virtual {v5, v2, v3}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 528
    const/4 v2, 0x1

    invoke-virtual {v5, v2}, Ljava/net/HttpURLConnection;->setDoOutput(Z)V

    .line 529
    const-string v12, ""

    .line 530
    .local v12, postParam:Ljava/lang/String;
    if-eqz p2, :cond_2

    .line 531
    invoke-static/range {p2 .. p2}, Lt4j/http/HttpClient;->encodeParameters([Lt4j/http/PostParameter;)Ljava/lang/String;

    move-result-object v12

    .line 533
    :cond_2
    const-string v2, "Post Params: "

    invoke-static {v2, v12}, Lt4j/http/HttpClient;->log(Ljava/lang/String;Ljava/lang/String;)V

    .line 534
    const-string v2, "UTF-8"

    invoke-virtual {v12, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v8

    .line 536
    .local v8, bytes:[B
    const-string v2, "Content-Length"

    .line 537
    array-length v3, v8

    invoke-static {v3}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v3

    .line 536
    invoke-virtual {v5, v2, v3}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 538
    invoke-virtual {v5}, Ljava/net/HttpURLConnection;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v11

    .line 539
    invoke-virtual {v11, v8}, Ljava/io/OutputStream;->write([B)V

    .line 540
    invoke-virtual {v11}, Ljava/io/OutputStream;->flush()V

    .line 541
    invoke-virtual {v11}, Ljava/io/OutputStream;->close()V

    .line 547
    .end local v8           #bytes:[B
    .end local v12           #postParam:Ljava/lang/String;
    :goto_2
    new-instance v13, Lt4j/http/Response;

    invoke-direct {v13, v5}, Lt4j/http/Response;-><init>(Ljava/net/HttpURLConnection;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 548
    .end local v14           #res:Lt4j/http/Response;
    .restart local v13       #res:Lt4j/http/Response;
    :try_start_1
    invoke-virtual {v5}, Ljava/net/HttpURLConnection;->getResponseCode()I

    move-result v15

    .line 549
    sget-boolean v2, Lt4j/http/HttpClient;->DEBUG:Z

    if-eqz v2, :cond_4

    .line 550
    const-string v2, "Response: "

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 551
    invoke-virtual {v5}, Ljava/net/HttpURLConnection;->getHeaderFields()Ljava/util/Map;

    move-result-object v16

    .line 552
    .local v16, responseHeaders:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"
    invoke-interface/range {v16 .. v16}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v2

    invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :cond_3
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-nez v3, :cond_8

    .line 563
    .end local v16           #responseHeaders:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"
    :cond_4
    const/16 v2, 0xc8

    if-eq v15, v2, :cond_a

    .line 564
    const/16 v2, 0x1f4

    if-lt v15, v2, :cond_5

    move-object/from16 v0, p0

    iget v2, v0, Lt4j/http/HttpClient;->retryCount:I

    move/from16 v0, v17

    if-ne v0, v2, :cond_b

    .line 565
    :cond_5
    new-instance v2, Lt4j/TBlogException;

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-static {v15}, Lt4j/http/HttpClient;->getCause(I)Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v4, "\n"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v13}, Lt4j/http/Response;->asString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3, v15}, Lt4j/TBlogException;-><init>(Ljava/lang/String;I)V

    throw v2
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 571
    :catchall_0
    move-exception v2

    .line 573
    :goto_3
    :try_start_2
    invoke-virtual {v11}, Ljava/io/OutputStream;->close()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    .line 576
    :goto_4
    :try_start_3
    throw v2
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_0

    .line 577
    :catch_0
    move-exception v9

    .line 579
    .local v9, ioe:Ljava/io/IOException;
    move-object/from16 v0, p0

    iget v2, v0, Lt4j/http/HttpClient;->retryCount:I

    move/from16 v0, v17

    if-ne v0, v2, :cond_c

    .line 580
    new-instance v2, Lt4j/TBlogException;

    invoke-virtual {v9}, Ljava/io/IOException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-direct {v2, v3, v9, v15}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v2

    .line 542
    .end local v9           #ioe:Ljava/io/IOException;
    .end local v13           #res:Lt4j/http/Response;
    .restart local v14       #res:Lt4j/http/Response;
    :cond_6
    :try_start_4
    const-string v2, "DELETE"

    move-object/from16 v0, p4

    invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_7

    .line 543
    const-string v2, "DELETE"

    invoke-virtual {v5, v2}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V

    goto :goto_2

    .line 571
    :catchall_1
    move-exception v2

    move-object v13, v14

    .end local v14           #res:Lt4j/http/Response;
    .restart local v13       #res:Lt4j/http/Response;
    goto :goto_3

    .line 545
    .end local v13           #res:Lt4j/http/Response;
    .restart local v14       #res:Lt4j/http/Response;
    :cond_7
    const-string v2, "GET"

    invoke-virtual {v5, v2}, Ljava/net/HttpURLConnection;->setRequestMethod(Ljava/lang/String;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    goto/16 :goto_2

    .line 552
    .end local v14           #res:Lt4j/http/Response;
    .restart local v13       #res:Lt4j/http/Response;
    .restart local v16       #responseHeaders:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"
    :cond_8
    :try_start_5
    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/lang/String;

    .line 553
    .local v10, key:Ljava/lang/String;
    move-object/from16 v0, v16

    invoke-interface {v0, v10}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v20

    check-cast v20, Ljava/util/List;

    .line 554
    .local v20, values:Ljava/util/List;,"Ljava/util/List<Ljava/lang/String;>;"
    invoke-interface/range {v20 .. v20}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_5
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_3

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v19

    check-cast v19, Ljava/lang/String;

    .line 555
    .local v19, value:Ljava/lang/String;
    if-eqz v10, :cond_9

    .line 556
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static {v10}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v6

    invoke-direct {v4, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v6, ": "

    invoke-virtual {v4, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    move-object/from16 v0, v19

    invoke-virtual {v4, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v4}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    goto :goto_5

    .line 558
    :cond_9
    invoke-static/range {v19 .. v19}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    goto :goto_5

    .line 573
    .end local v10           #key:Ljava/lang/String;
    .end local v16           #responseHeaders:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/util/List<Ljava/lang/String;>;>;"
    .end local v19           #value:Ljava/lang/String;
    .end local v20           #values:Ljava/util/List;,"Ljava/util/List<Ljava/lang/String;>;"
    :cond_a
    :try_start_6
    invoke-virtual {v11}, Ljava/io/OutputStream;->close()V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_1
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_0

    goto/16 :goto_1

    .line 574
    :catch_1
    move-exception v2

    goto/16 :goto_1

    .line 573
    :cond_b
    :try_start_7
    invoke-virtual {v11}, Ljava/io/OutputStream;->close()V
    :try_end_7
    .catch Ljava/lang/Exception; {:try_start_7 .. :try_end_7} :catch_3
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_0

    .line 584
    :cond_c
    :goto_6
    :try_start_8
    sget-boolean v2, Lt4j/http/HttpClient;->DEBUG:Z

    if-eqz v2, :cond_d

    if-eqz v13, :cond_d

    .line 585
    invoke-virtual {v13}, Lt4j/http/Response;->asString()Ljava/lang/String;

    .line 587
    :cond_d
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "Sleeping "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p0

    iget v3, v0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " millisecs for next retry."

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 588
    move-object/from16 v0, p0

    iget v2, v0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    int-to-long v2, v2

    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_8
    .catch Ljava/lang/InterruptedException; {:try_start_8 .. :try_end_8} :catch_4

    .line 515
    :goto_7
    add-int/lit8 v17, v17, 0x1

    move-object v14, v13

    .end local v13           #res:Lt4j/http/Response;
    .restart local v14       #res:Lt4j/http/Response;
    goto/16 :goto_0

    .line 574
    .end local v14           #res:Lt4j/http/Response;
    .restart local v13       #res:Lt4j/http/Response;
    :catch_2
    move-exception v3

    goto/16 :goto_4

    :catch_3
    move-exception v2

    goto :goto_6

    .line 589
    :catch_4
    move-exception v2

    goto :goto_7
.end method

.method public isAuthenticationEnabled()Z
    .locals 1

    .prologue
    .line 147
    iget-object v0, p0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-nez v0, :cond_0

    iget-object v0, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method public multPartURL(Ljava/lang/String;Ljava/lang/String;[Lt4j/http/PostParameter;Ljava/io/File;Z)Lt4j/http/Response;
    .locals 20
    .parameter "fileParamName"
    .parameter "url"
    .parameter "params"
    .parameter "file"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 418
    new-instance v16, Lorg/apache/commons/httpclient/methods/PostMethod;

    move-object/from16 v0, v16

    move-object/from16 v1, p2

    invoke-direct {v0, v1}, Lorg/apache/commons/httpclient/methods/PostMethod;-><init>(Ljava/lang/String;)V

    .line 419
    .local v16, post:Lorg/apache/commons/httpclient/methods/PostMethod;
    new-instance v9, Lorg/apache/commons/httpclient/HttpClient;

    invoke-direct {v9}, Lorg/apache/commons/httpclient/HttpClient;-><init>()V

    .line 421
    .local v9, client:Lorg/apache/commons/httpclient/HttpClient;
    :try_start_0
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v18

    .line 422
    .local v18, t:J
    const/4 v15, 0x0

    check-cast v15, [Lorg/apache/commons/httpclient/methods/multipart/Part;

    .line 423
    .local v15, parts:[Lorg/apache/commons/httpclient/methods/multipart/Part;
    if-nez p3, :cond_3

    .line 424
    const/4 v3, 0x1

    new-array v15, v3, [Lorg/apache/commons/httpclient/methods/multipart/Part;

    .line 428
    :goto_0
    if-eqz p3, :cond_0

    .line 429
    const/4 v13, 0x0

    .line 430
    .local v13, i:I
    move-object/from16 v0, p3

    array-length v4, v0

    const/4 v3, 0x0

    move v14, v13

    .end local v13           #i:I
    .local v14, i:I
    :goto_1
    if-lt v3, v4, :cond_4

    .line 434
    .end local v14           #i:I
    :cond_0
    new-instance v2, Lorg/apache/commons/httpclient/methods/multipart/FilePart;

    invoke-virtual/range {p4 .. p4}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v4

    new-instance v3, Ljavax/activation/MimetypesFileTypeMap;

    invoke-direct {v3}, Ljavax/activation/MimetypesFileTypeMap;-><init>()V

    move-object/from16 v0, p4

    invoke-virtual {v3, v0}, Ljavax/activation/MimetypesFileTypeMap;->getContentType(Ljava/io/File;)Ljava/lang/String;

    move-result-object v6

    const-string v7, "UTF-8"

    move-object/from16 v3, p1

    move-object/from16 v5, p4

    invoke-direct/range {v2 .. v7}, Lorg/apache/commons/httpclient/methods/multipart/FilePart;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;Ljava/lang/String;Ljava/lang/String;)V

    .line 435
    .local v2, filePart:Lorg/apache/commons/httpclient/methods/multipart/FilePart;
    const-string v3, "binary"

    invoke-virtual {v2, v3}, Lorg/apache/commons/httpclient/methods/multipart/FilePart;->setTransferEncoding(Ljava/lang/String;)V

    .line 436
    array-length v3, v15

    add-int/lit8 v3, v3, -0x1

    aput-object v2, v15, v3

    .line 438
    new-instance v3, Lorg/apache/commons/httpclient/methods/multipart/MultipartRequestEntity;

    invoke-virtual/range {v16 .. v16}, Lorg/apache/commons/httpclient/methods/PostMethod;->getParams()Lorg/apache/commons/httpclient/params/HttpMethodParams;

    move-result-object v4

    invoke-direct {v3, v15, v4}, Lorg/apache/commons/httpclient/methods/multipart/MultipartRequestEntity;-><init>([Lorg/apache/commons/httpclient/methods/multipart/Part;Lorg/apache/commons/httpclient/params/HttpMethodParams;)V

    move-object/from16 v0, v16

    invoke-virtual {v0, v3}, Lorg/apache/commons/httpclient/methods/PostMethod;->setRequestEntity(Lorg/apache/commons/httpclient/methods/RequestEntity;)V

    .line 439
    new-instance v12, Ljava/util/ArrayList;

    invoke-direct {v12}, Ljava/util/ArrayList;-><init>()V

    .line 441
    .local v12, headers:Ljava/util/List;,"Ljava/util/List<Lorg/apache/commons/httpclient/Header;>;"
    if-eqz p5, :cond_2

    .line 442
    move-object/from16 v0, p0

    iget-object v3, v0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-nez v3, :cond_1

    .line 444
    :cond_1
    const/4 v8, 0x0

    .line 445
    .local v8, authorization:Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v3, v0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    if-eqz v3, :cond_5

    .line 447
    move-object/from16 v0, p0

    iget-object v3, v0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    const-string v4, "POST"

    move-object/from16 v0, p0

    iget-object v5, v0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    move-object/from16 v0, p2

    move-object/from16 v1, p3

    invoke-virtual {v3, v4, v0, v1, v5}, Lt4j/http/OAuth;->generateAuthorizationHeader(Ljava/lang/String;Ljava/lang/String;[Lt4j/http/PostParameter;Lt4j/http/OAuthToken;)Ljava/lang/String;

    move-result-object v8

    .line 455
    :goto_2
    new-instance v3, Lorg/apache/commons/httpclient/Header;

    const-string v4, "Authorization"

    invoke-direct {v3, v4, v8}, Lorg/apache/commons/httpclient/Header;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v12, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 456
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Authorization: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V

    .line 458
    .end local v8           #authorization:Ljava/lang/String;
    :cond_2
    invoke-virtual {v9}, Lorg/apache/commons/httpclient/HttpClient;->getHostConfiguration()Lorg/apache/commons/httpclient/HostConfiguration;

    move-result-object v3

    invoke-virtual {v3}, Lorg/apache/commons/httpclient/HostConfiguration;->getParams()Lorg/apache/commons/httpclient/params/HostParams;

    move-result-object v3

    const-string v4, "http.default-headers"

    invoke-virtual {v3, v4, v12}, Lorg/apache/commons/httpclient/params/HostParams;->setParameter(Ljava/lang/String;Ljava/lang/Object;)V

    .line 459
    move-object/from16 v0, v16

    invoke-virtual {v9, v0}, Lorg/apache/commons/httpclient/HttpClient;->executeMethod(Lorg/apache/commons/httpclient/HttpMethod;)I

    .line 461
    new-instance v17, Lt4j/http/Response;

    invoke-direct/range {v17 .. v17}, Lt4j/http/Response;-><init>()V

    .line 462
    .local v17, response:Lt4j/http/Response;
    invoke-virtual/range {v16 .. v16}, Lorg/apache/commons/httpclient/methods/PostMethod;->getResponseBodyAsString()Ljava/lang/String;

    move-result-object v3

    move-object/from16 v0, v17

    invoke-virtual {v0, v3}, Lt4j/http/Response;->setResponseAsString(Ljava/lang/String;)V

    .line 463
    invoke-virtual/range {v16 .. v16}, Lorg/apache/commons/httpclient/methods/PostMethod;->getStatusCode()I

    move-result v3

    move-object/from16 v0, v17

    invoke-virtual {v0, v3}, Lt4j/http/Response;->setStatusCode(I)V

    .line 465
    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "multPartURL URL:"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object/from16 v0, p2

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", result:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    move-object/from16 v0, v17

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, ", time:"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    sub-long v4, v4, v18

    invoke-virtual {v3, v4, v5}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lt4j/http/HttpClient;->log(Ljava/lang/String;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 470
    invoke-virtual/range {v16 .. v16}, Lorg/apache/commons/httpclient/methods/PostMethod;->releaseConnection()V

    .line 471
    const/4 v9, 0x0

    .line 466
    return-object v17

    .line 426
    .end local v2           #filePart:Lorg/apache/commons/httpclient/methods/multipart/FilePart;
    .end local v12           #headers:Ljava/util/List;,"Ljava/util/List<Lorg/apache/commons/httpclient/Header;>;"
    .end local v17           #response:Lt4j/http/Response;
    :cond_3
    :try_start_1
    move-object/from16 v0, p3

    array-length v3, v0

    add-int/lit8 v3, v3, 0x1

    new-array v15, v3, [Lorg/apache/commons/httpclient/methods/multipart/Part;

    goto/16 :goto_0

    .line 430
    .restart local v14       #i:I
    :cond_4
    aget-object v10, p3, v3

    .line 431
    .local v10, entry:Lt4j/http/PostParameter;
    add-int/lit8 v13, v14, 0x1

    .end local v14           #i:I
    .restart local v13       #i:I
    new-instance v5, Lorg/apache/commons/httpclient/methods/multipart/StringPart;

    invoke-virtual {v10}, Lt4j/http/PostParameter;->getName()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v10}, Lt4j/http/PostParameter;->getValue()Ljava/lang/String;

    move-result-object v7

    invoke-direct {v5, v6, v7}, Lorg/apache/commons/httpclient/methods/multipart/StringPart;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    aput-object v5, v15, v14

    .line 430
    add-int/lit8 v3, v3, 0x1

    move v14, v13

    .end local v13           #i:I
    .restart local v14       #i:I
    goto/16 :goto_1

    .line 448
    .end local v10           #entry:Lt4j/http/PostParameter;
    .end local v14           #i:I
    .restart local v2       #filePart:Lorg/apache/commons/httpclient/methods/multipart/FilePart;
    .restart local v8       #authorization:Ljava/lang/String;
    .restart local v12       #headers:Ljava/util/List;,"Ljava/util/List<Lorg/apache/commons/httpclient/Header;>;"
    :cond_5
    move-object/from16 v0, p0

    iget-object v3, v0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    if-eqz v3, :cond_6

    .line 450
    move-object/from16 v0, p0

    iget-object v8, v0, Lt4j/http/HttpClient;->basic:Ljava/lang/String;

    goto/16 :goto_2

    .line 452
    :cond_6
    new-instance v3, Ljava/lang/IllegalStateException;

    .line 453
    const-string v4, "Neither user ID/password combination nor OAuth consumer key/secret combination supplied"

    .line 452
    invoke-direct {v3, v4}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw v3
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 467
    .end local v2           #filePart:Lorg/apache/commons/httpclient/methods/multipart/FilePart;
    .end local v8           #authorization:Ljava/lang/String;
    .end local v12           #headers:Ljava/util/List;,"Ljava/util/List<Lorg/apache/commons/httpclient/Header;>;"
    .end local v15           #parts:[Lorg/apache/commons/httpclient/methods/multipart/Part;
    .end local v18           #t:J
    :catch_0
    move-exception v11

    .line 468
    .local v11, ex:Ljava/lang/Exception;
    :try_start_2
    new-instance v3, Lt4j/TBlogException;

    invoke-virtual {v11}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v4

    const/4 v5, -0x1

    invoke-direct {v3, v4, v11, v5}, Lt4j/TBlogException;-><init>(Ljava/lang/String;Ljava/lang/Exception;I)V

    throw v3
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 469
    .end local v11           #ex:Ljava/lang/Exception;
    :catchall_0
    move-exception v3

    .line 470
    invoke-virtual/range {v16 .. v16}, Lorg/apache/commons/httpclient/methods/PostMethod;->releaseConnection()V

    .line 471
    const/4 v9, 0x0

    .line 472
    throw v3
.end method

.method public post(Ljava/lang/String;)Lt4j/http/Response;
    .locals 2
    .parameter "url"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 486
    new-array v0, v1, [Lt4j/http/PostParameter;

    invoke-virtual {p0, p1, v0, v1}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public post(Ljava/lang/String;Z)Lt4j/http/Response;
    .locals 1
    .parameter "url"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 476
    const/4 v0, 0x0

    new-array v0, v0, [Lt4j/http/PostParameter;

    invoke-virtual {p0, p1, v0, p2}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public post(Ljava/lang/String;[Lt4j/http/PostParameter;)Lt4j/http/Response;
    .locals 1
    .parameter "url"
    .parameter "PostParameters"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 481
    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, v0}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v0

    return-object v0
.end method

.method public post(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;
    .locals 2
    .parameter "url"
    .parameter "postParameters"
    .parameter "authenticated"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 408
    move-object v0, p2

    .line 410
    .local v0, newPostParameters:[Lt4j/http/PostParameter;
    invoke-virtual {p0, p1, v0, p3}, Lt4j/http/HttpClient;->httpRequest(Ljava/lang/String;[Lt4j/http/PostParameter;Z)Lt4j/http/Response;

    move-result-object v1

    return-object v1
.end method

.method public setAccessTokenURL(Ljava/lang/String;)V
    .locals 0
    .parameter "accessTokenURL"

    .prologue
    .line 294
    iput-object p1, p0, Lt4j/http/HttpClient;->accessTokenURL:Ljava/lang/String;

    .line 295
    return-void
.end method

.method public setConnectionTimeout(I)V
    .locals 1
    .parameter "connectionTimeout"

    .prologue
    .line 359
    invoke-static {p1}, Lt4j/Configuration;->getConnectionTimeout(I)I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->connectionTimeout:I

    .line 361
    return-void
.end method

.method public setOAuthAccessToken(Lt4j/http/AccessToken;)V
    .locals 0
    .parameter "token"

    .prologue
    .line 278
    iput-object p1, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 279
    return-void
.end method

.method public setOAuthConsumer(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter "consumerKey"
    .parameter "consumerSecret"

    .prologue
    .line 156
    invoke-static {p1}, Lt4j/Configuration;->getOAuthConsumerKey(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    .line 157
    invoke-static {p2}, Lt4j/Configuration;->getOAuthConsumerSecret(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p2

    .line 158
    if-eqz p1, :cond_0

    if-eqz p2, :cond_0

    .line 159
    invoke-virtual {p1}, Ljava/lang/String;->length()I

    move-result v0

    if-eqz v0, :cond_0

    invoke-virtual {p2}, Ljava/lang/String;->length()I

    move-result v0

    if-eqz v0, :cond_0

    .line 160
    new-instance v0, Lt4j/http/OAuth;

    invoke-direct {v0, p1, p2}, Lt4j/http/OAuth;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lt4j/http/HttpClient;->oauth:Lt4j/http/OAuth;

    .line 162
    :cond_0
    return-void
.end method

.method public setPassword(Ljava/lang/String;)V
    .locals 0
    .parameter "password"

    .prologue
    .line 134
    iput-object p1, p0, Lt4j/http/HttpClient;->password:Ljava/lang/String;

    .line 135
    invoke-direct {p0}, Lt4j/http/HttpClient;->encodeBasicAuthenticationString()V

    .line 136
    return-void
.end method

.method public setProxyAuthPassword(Ljava/lang/String;)V
    .locals 1
    .parameter "proxyAuthPassword"

    .prologue
    .line 347
    invoke-static {p1}, Lt4j/Configuration;->getProxyPassword(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyAuthPassword:Ljava/lang/String;

    .line 348
    return-void
.end method

.method public setProxyAuthUser(Ljava/lang/String;)V
    .locals 1
    .parameter "proxyAuthUser"

    .prologue
    .line 335
    invoke-static {p1}, Lt4j/Configuration;->getProxyUser(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyAuthUser:Ljava/lang/String;

    .line 336
    return-void
.end method

.method public setProxyHost(Ljava/lang/String;)V
    .locals 1
    .parameter "proxyHost"

    .prologue
    .line 311
    invoke-static {p1}, Lt4j/Configuration;->getProxyHost(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lt4j/http/HttpClient;->proxyHost:Ljava/lang/String;

    .line 312
    return-void
.end method

.method public setProxyPort(I)V
    .locals 1
    .parameter "proxyPort"

    .prologue
    .line 323
    invoke-static {p1}, Lt4j/Configuration;->getProxyPort(I)I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->proxyPort:I

    .line 324
    return-void
.end method

.method public setReadTimeout(I)V
    .locals 1
    .parameter "readTimeout"

    .prologue
    .line 371
    invoke-static {p1}, Lt4j/Configuration;->getReadTimeout(I)I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->readTimeout:I

    .line 372
    return-void
.end method

.method public setRequestHeader(Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter "name"
    .parameter "value"

    .prologue
    .line 645
    iget-object v0, p0, Lt4j/http/HttpClient;->requestHeaders:Ljava/util/Map;

    invoke-interface {v0, p1, p2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 646
    return-void
.end method

.method public setRequestTokenURL(Ljava/lang/String;)V
    .locals 0
    .parameter "requestTokenURL"

    .prologue
    .line 282
    iput-object p1, p0, Lt4j/http/HttpClient;->requestTokenURL:Ljava/lang/String;

    .line 283
    return-void
.end method

.method public setRetryCount(I)V
    .locals 2
    .parameter "retryCount"

    .prologue
    .line 383
    if-ltz p1, :cond_0

    .line 384
    invoke-static {p1}, Lt4j/Configuration;->getRetryCount(I)I

    move-result v0

    iput v0, p0, Lt4j/http/HttpClient;->retryCount:I

    .line 388
    return-void

    .line 386
    :cond_0
    new-instance v0, Ljava/lang/IllegalArgumentException;

    const-string v1, "RetryCount cannot be negative."

    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public setRetryIntervalSecs(I)V
    .locals 2
    .parameter "retryIntervalSecs"

    .prologue
    .line 398
    if-ltz p1, :cond_0

    .line 399
    invoke-static {p1}, Lt4j/Configuration;->getRetryIntervalSecs(I)I

    move-result v0

    mul-int/lit16 v0, v0, 0x3e8

    iput v0, p0, Lt4j/http/HttpClient;->retryIntervalMillis:I

    .line 404
    return-void

    .line 401
    :cond_0
    new-instance v0, Ljava/lang/IllegalArgumentException;

    .line 402
    const-string v1, "RetryInterval cannot be negative."

    .line 401
    invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public setToken(Ljava/lang/String;Ljava/lang/String;)Lt4j/http/RequestToken;
    .locals 1
    .parameter "token"
    .parameter "tokenSecret"

    .prologue
    .line 165
    new-instance v0, Lt4j/http/RequestToken;

    invoke-direct {v0, p1, p2}, Lt4j/http/RequestToken;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    iput-object v0, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    .line 166
    iget-object v0, p0, Lt4j/http/HttpClient;->oauthToken:Lt4j/http/OAuthToken;

    check-cast v0, Lt4j/http/RequestToken;

    return-object v0
.end method

.method public setUserAgent(Ljava/lang/String;)V
    .locals 2
    .parameter "ua"

    .prologue
    .line 391
    const-string v0, "User-Agent"

    invoke-static {p1}, Lt4j/Configuration;->getUserAgent(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p0, v0, v1}, Lt4j/http/HttpClient;->setRequestHeader(Ljava/lang/String;Ljava/lang/String;)V

    .line 392
    return-void
.end method

.method public setUserId(Ljava/lang/String;)V
    .locals 0
    .parameter "userId"

    .prologue
    .line 129
    iput-object p1, p0, Lt4j/http/HttpClient;->userId:Ljava/lang/String;

    .line 130
    invoke-direct {p0}, Lt4j/http/HttpClient;->encodeBasicAuthenticationString()V

    .line 131
    return-void
.end method
